GXUnionRectangle
You can use theGXUnionRectangle
function to find the smallest rectangle that contains two other rectangles.
gxRectangle *GXUnionRectangle(gxRectangle *target, const gxRectangle *source, const gxRectangle *operand);
target
- A pointer to a
gxRectangle
structure. On return, the smallest rectangle containing both the source and operand rectangles.source
- A pointer to one of the rectangles to combine.
operand
- A pointer to the other rectangle to combine.
- function result
- The smallest rectangle containing both the source and operand
rectangles. (This rectangle is the same as the rectangle returned in thetarget
parameter.)DESCRIPTION
TheGXUnionRectangle
function calculates the smallest rectangle containing both the source rectangle and the operand rectangle and stores the results intarget
parameter. This function also returns the calculated rectangle as its function result.You may specify the source rectangle or the operand rectangle as the target rectangle. In this case, the function calculates the smallest rectangle containing both of the original rectangles and then places the calculated rectangle into the source or operand rectangle, as specified.
Notice that the parameters to this function are not shapes, but pointers to the
gxRectangle
data structures.ERRORS, WARNINGS, AND NOTICES
Errors parameter_is_nil SEE ALSO
For a discussion of thegxRectangle
data structure, see Chapter 2, "Geometric Shapes," in this book.For a discussion of geometric arithmetic, see "Geometric Arithmetic" beginning on page 4-21.
To find the intersection of two rectangles, use the
GXIntersectRectangle
function, described in this previous section.To find the union of two shapes, use the
GXUnionShape
function, described on page 4-109.